#pragma once

#include <cppwinks/network/tcp/ClientConnection.h>

#include <set>

#include <string>

class ChatService
{
private:
    // 客户端连接集合
    std::set<network::ClientConnection *> connections;

public:
    // 设置连接到集合中
    void set(network::ClientConnection *connection);
    // 发送数据
    void send(network::ClientConnection *self, const std::string &msg);
    // 断开连接
    void remove(network::ClientConnection *connection);
};

extern ChatService *chat_service;
